/*
	lock.h

	contains headers for kernel locking control functions

	Author: Aidan Goddard 11/7/14
*/

#ifndef LOCK_H_INCLUDED
#define LOCK_H_INCLUDED

// the common lock structure
struct lock_table
 {
	uint64_t lock_key;
	uint64_t flags_state;
	uint64_t reserved1;
	uint64_t reserved2;
};

// lock structure init
static inline void lock_table_init(struct lock_table *l)
{
	l->flags_state = 0;
	l->lock_key = 0;
	return;
}

// level-1 lock and unlock
void lock_no_IRQ(struct lock_table *l);
void unlock_no_IRQ(struct lock_table *l);

#endif